// 定义枚举
var Gender;
(function (Gender) {
    Gender[Gender["Male"] = 0] = "Male";
    Gender[Gender["Female"] = 1] = "Female";
})(Gender || (Gender = {}));
// 使用枚举
var obj;
obj = { name: "SunWuKong", gender: Gender.Male };
console.log(obj);
console.log(obj.gender == Gender.Male);
var male = Gender[0];
var female = Gender[1];
console.log(male, female);
// 手动赋值1
var Animal;
(function (Animal) {
    Animal[Animal["Dog"] = 1] = "Dog";
    Animal[Animal["Cat"] = 2] = "Cat";
    Animal[Animal["Sheep"] = 3] = "Sheep";
})(Animal || (Animal = {}));
var cat = Animal.Cat;
console.log(cat);
// 手动赋值2
var Color;
(function (Color) {
    Color[Color["Red"] = 1] = "Red";
    Color[Color["Green"] = 2] = "Green";
    Color[Color["Blue"] = 4] = "Blue";
})(Color || (Color = {}));
var color1 = Color.Green;
var color2 = Color[4];
console.log(color1);
console.log(color2);
